package com.mijie.homi.dao.user;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.mijie.core.IBatisDao;
import com.mijie.homi.common.domain.user.Setting;

@Repository
public class SettingDao extends IBatisDao{

	public Setting getSettingByUserId(int userId){
		return this.selectOne("getSettingByUserId",userId);
	}
	
	public int updateSetting(Setting setting){
		return this.update("updateSetting", setting);
	}
	
	@Transactional
	public int addSetting(int userId){
		return this.update("addSetting",userId);
	}
	
	public List<Setting> listReceiveNearbyMoodUserId(int offset,int limit){
		Map<String,Object> parameter = new HashMap<String,Object>(2);
		parameter.put("offset", offset);
		parameter.put("limit", limit);
		return this.selectList("listReceiveNearbyMoodUserId", parameter);
	}
}
